﻿using System;
using System.Collections.Generic;
using System.Text;
using JsonSharp;
using Barbar.MapReport.Common;
using JsonSharp.Values;
using JsonSharp.Collections;

namespace Barbar.MapReport.HtmlRender.Json {
  internal class GeoPointFactory : JsonFactory {
    private GeoPoint m_Point;

    public GeoPointFactory(GeoPoint point) {
      m_Point = point;
    }

    public override JsonValue ToJsonObject() {
      JsonObjects result = new JsonObjects();
      result.Add(new JsonStringValue("g"), new JsonNumberValue(m_Point.Longitude));
      result.Add(new JsonStringValue("t"), new JsonNumberValue(m_Point.Latitude));
      return result;
    }
  }
}
